package com.ck.controller.teacher;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.ck.domain.Banji;
import com.ck.service.TeacherService;

public class ShowBanjiListController extends AbstractController {
	
	private TeacherService teacherService;

	public void setTeacherService(TeacherService teacherService) {
		this.teacherService = teacherService;
	}

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		Map model = new HashMap();
		
		List<Banji> banjiList = teacherService.gainBanjiList();
		
		model.put("banjiList", banjiList);
		
		return new ModelAndView("teacher/showBanjiList", model);
	}

}
